﻿@{
    ViewBag.Title = "Dashboard";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";

    var a = new double[] { ViewBag.ListAddFundThisWeek.Item1, ViewBag.ListAddFundThisWeek.Item2, ViewBag.ListAddFundThisWeek.Item3, ViewBag.ListAddFundThisWeek.Item4, ViewBag.ListAddFundThisWeek.Item5, ViewBag.ListAddFundThisWeek.Item6, ViewBag.ListAddFundThisWeek.Item7 };
    var b = new double[] { ViewBag.ListCahoutThisWeek.Item1, ViewBag.ListCahoutThisWeek.Item2, ViewBag.ListCahoutThisWeek.Item3, ViewBag.ListCahoutThisWeek.Item4, ViewBag.ListCahoutThisWeek.Item5, ViewBag.ListCahoutThisWeek.Item6, ViewBag.ListCahoutThisWeek.Item7 };
    var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
    var c = serializer.Serialize(a);
    var d = serializer.Serialize(b);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="~/js/bootstrap.min.js"></script>
    <link href="~/css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet" type="text/css" />
    <link href="~/css/icheck/flat/green.css" rel="stylesheet" />
    <link href="~/fonts/css/font-awesome.min.css" rel="stylesheet" />
</head>
<body class="nav-md">
    <div class="right_col" role="main">
        <b style="color:red">@ViewBag.Err</b>
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="dashboard_graph">

                    <div class="row x_title">
                        <div class="col-md-6">
                            <h3>Statistics</h3>
                        </div>
                    </div>
                    <div class="col-md-12 col-sm-9 col-xs-12">
                        <div id="placeholder33" style="height: 260px; display: none" class="demo-placeholder"></div>
                        <div style="width: 100%;">
                            <canvas id="myChart" width="400" height="100" class="demo-placeholder"></canvas>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-12 col-sm-12 col-xs-12">
                <hr style="width:100%;color:red; font-weight:bold;">
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <div class="panel-heading" style="font-weight:bold;">
                            Add Fund Statisics
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class=" table-hover">
                                    <thead>
                                        <tr>
                                            <th style="font-weight:normal">

                                                New Fund:<br />
                                                Today:<br />
                                                Yesterday:<br />
                                                This Week:<br />
                                                Last Week:<br />
                                            </th>
                                            <th style="width:250px;"></th>
                                            <th style="font-weight: normal">
                                                $ @String.Format("{0:N}", @ViewBag.AddFund.Item1) <br />
                                                $ @String.Format("{0:N}", @ViewBag.AddFund.Item2) <br />
                                                $ @String.Format("{0:N}", @ViewBag.AddFund.Item3) <br />
                                                $ @String.Format("{0:N}", @ViewBag.AddFund.Item4)  <br />
                                                $ @String.Format("{0:N}", @ViewBag.AddFund.Item5)  <br />
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading" style="font-weight:bold">
                                Cask Bank Statisic
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table-hover">
                                        <thead>
                                            <tr>
                                                <th style="font-weight:normal">

                                                    Today Received:<br />
                                                    Yesterday Received:<br />
                                                    Today Used:<br />
                                                    Yesterday Used:<br />
                                                    Total Week Received:<br />
                                                    Total Week Used: <br />
                                                    Remaining Amount:
                                                </th>
                                                <th style="width:200px;"></th>
                                                <th style="font-weight: normal">
                                                    $ @String.Format("{0:N}", @ViewBag.CashTodayReceived)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.CashYesterday)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.UserUsedToday)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.UserUsedFerfectYesterday)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.SumAmountTotalWeekreceived)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.SumAmountTotalWeekUsed)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.Blance)<br />


                                                </th>
                                            </tr>
                                        </thead>

                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- /.panel -->
                    </div>
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading" style="font-weight:bold">
                                Fund Bank Statisic
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table-hover">
                                        <thead>
                                            <tr>
                                                <th style="font-weight:normal">

                                                    Today Received:<br />
                                                    Total Received:<br />
                                                    Total Amount:
                                                </th>
                                                <th style="width:220px;"></th>
                                                <th style="font-weight: normal">
                                                    $ @String.Format("{0:N}", @ViewBag.SumFundToday)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.FundTotal)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.BlanFund) <br />

                                                </th>
                                            </tr>
                                        </thead>

                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                    <!-- /.panel -->
                </div>
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <p style="font-weight:bold;"> Cashout Statisics</p>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table-hover">
                                    <thead>
                                        <tr>
                                            <th style="font-weight:normal">

                                                Last Cashout:<br />
                                                Today:<br />
                                                Yesterday:<br />
                                                This Week:<br />
                                                Last Week:<br />
                                            </th>
                                            <th style="width:250px;"></th>
                                            <th style="font-weight: normal">
                                                $ @String.Format("{0:N}", @ViewBag.Caskhout.Item1)<br />
                                                $ @String.Format("{0:N}", @ViewBag.Caskhout.Item2) <br />
                                                $ @String.Format("{0:N}", @ViewBag.Caskhout.Item3) <br />
                                                $ @String.Format("{0:N}", @ViewBag.Caskhout.Item4) <br />
                                                $ @String.Format("{0:N}", @ViewBag.Caskhout.Item5) <br />
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>

                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading" style="font-weight:bold">
                                Fee This Week Statisic
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table-hover">
                                        <thead>
                                            <tr>
                                                <th style="font-weight:normal">
                                                    Up.Starter:<br />
                                                    Up.Investor:<br />
                                                    Up.Business:<br />
                                                </th>
                                                <th style="width:220px;"></th>
                                                <th style="font-weight: normal">

                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item1)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item2)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item3)<br />
                                                </th>
                                            </tr>
                                        </thead>

                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                    <div class="col-lg-12">
                        <div class="panel panel-default">
                            <div class="panel-heading" style="font-weight:bold">
                                Fee Last Week Statisic
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table-hover">
                                        <thead>
                                            <tr>
                                                <th style="font-weight:normal">
                                                    Up.Starter:<br />
                                                    Up.Investor:<br />
                                                    Up.Business:<br />
                                                </th>
                                                <th style="width:220px;"></th>
                                                <th style="font-weight: normal">
                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item4)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item5)<br />
                                                    $ @String.Format("{0:N}", @ViewBag.FeeThisWeek.Item6)<br />
                                                </th>
                                            </tr>
                                        </thead>
                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>

                    <!-- /.panel -->
                </div>
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading" style="font-weight:bold">
                            Sub Bank Statisic
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Sub Bank Name</th>
                                            <th>Ferfectmoney</th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        @{int j = 0;}
                                        @foreach (var item in ViewBag.ListSub)
                                        {
                                            j++;
                                            <tr>
                                                <td>@j</td>
                                                <td>@item.Name</td>
                                                <td>@String.Format("{0:N}", item.Blance)</td>

                                            </tr>
                                        }

                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <script src="~/js/bootstrap.min.js"></script>
    <script src="~/js/chartjs/Chart.js"></script>
    <script type="text/javascript">
        var dataLine = {
            labels: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
            datasets: [
                {
                    label: "Add fund",
                    fillColor: "rgba(220,220,220,0.2)",
                    strokeColor: "rgba(220,220,220,1)",
                    pointColor: "rgba(220,220,220,1)",
                    pointStrokeColor: "#fff",
                    pointHighlightFill: "#fff",
                    pointHighlightStroke: "rgba(220,220,220,1)",
                    data: @c
                    },
                {
                    label: "Cashout",
                    fillColor: "rgba(151,187,205,0.2)",
                    strokeColor: "rgba(151,187,205,1)",
                    pointColor: "rgba(151,187,205,1)",
                    pointStrokeColor: "#fff",
                    pointHighlightFill: "#fff",
                    pointHighlightStroke: "rgba(151,187,205,1)",
                    data: @d
                    }
            ]
        };
        $(document).ready(function ()
        {
            // Get context with jQuery - using jQuery's .get() method.
            var canvas = $('#myChart')[0];

            var ctx = canvas.getContext('2d');
            // This will get the first returned node in the jQuery collection.
            var myLineChart = new Chart(ctx).Line(dataLine, {
                responsive: true
            });
        })
    </script>
</body>

</html>
